package com.netty.service.controller;


import com.netty.service.chat.GroupChatServerHandler;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Classname TestController
 * @Description TODO
 * @Date 2023/12/14 16:08
 * @Created by jinxiaoyao
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @RequestMapping("/sendMsg")
    public String test(@RequestParam("content") String content, @RequestParam("channelId") String channelId){
        // 存在channel
        GroupChatServerHandler.channels.get(channelId).writeAndFlush(content);
        return "success";

    }
}
